#ifndef POWER_DRIVE_HPP
#define POWER_DRIVE_HPP
#include <arduino.h>

enum Channel {
    Heat = 0x00,
    Cool = 0x01,
    Fan = 0x02
};
enum SubChannel {
    Left = 0x00, 
    Center = 0x01,
    Right = 0x02,
    All = 0x0f
};

struct PowerDrive
{
    static bool init();
    static void enable();
    static void disable();
    static bool isEnabled();
    static bool setChannelPercent(Channel channel, SubChannel subChannel, uint8_t percentage);
    static bool setChannelPercentDur(int channel, int subchannel, int percentage, int durationSec);
    static bool setChannelPercentDecrease(int channel, int subchannel, int percentage, int durationSec);
    static bool setChannelPercentIncrease(int channel, int subchannel, int percentage, int durationSec);
    static bool setChannelFreq(int channel, int subchannel, int frequencyHz);
    static double getChannelFreq(int channel ,int subchannel);
    static void holdOn();
    static void holdOff();

    static int getFanPercent();
    // cross-subchannel impact taken into consideration
    static int getChannelNetWeightedPercent(SubChannel subChannel);

private:
    static bool flagIsEnabled;
};

#endif